package lerry.utils;

/**
 * ...
 * @author lerry
 */
class Color{
	static public inline var RED:UInt = 0xff0000;
	static public inline var GREEN:UInt = 0x00ff00;
	static public inline var BLUE:UInt = 0x0000ff;
	public function new() {
		
	}
	static public function getRed(color:UInt):UInt {
		return color >> 16 & 0xFF; 
	}
	static public function getGreen(color:UInt):UInt {
		return color >> 8 & 0xFF; 
	}
	static public function getBlue(color:UInt):UInt {
		return color & 0xFF; 
	}
	static public function getGray(color:UInt):UInt {
		return Std.int(getRed(color) * 0.3 + getGreen(color) * 0.59 + getBlue(color) * 0.11);
	}
}